#{extends 'main.html' /}
#{set title:'Results' /}

<h3>Search Results</h3>
#{if exams != null && exams.size() > 0}
	#{if exams.size() == 1}
	   <p><b>1 result</b></p>
	#{/if}
	#{else}
	   <p><b>${exams.size()} results</b></p>
	#{/else}

	#{list items:exams, as:'exam'}
		<h4><a href="@{PageController.exam(exam.id)}">Exam ${exam.id}</a></h4>
		<p>
		Date: ${exam.getDate().format('dd MMM yy')}<br>
		Patient: ${exam.getPatient().getName()}<br>
		Physician: ${exam.getPhysician().getName()}
		 <!-- Date, patient name, physician name -->
		</p>
		
	#{/list}

#{/if}
#{else}

<b>No results</b>

#{/else}
